package klass.parse.domain.constant;

import java.util.List;

public class ConstantStringInfo extends PostProcessConstant {

    private int refIndex;
    private ConstantUtf8Info valueRef;

    public ConstantStringInfo(int refIndex) {
        this.refIndex = refIndex;
    }

    @Override
    public short getTypeCode() {
        return 8;
    }

    @Override
    public String getTypeName() {
        return "String";
    }

    @Override
    public void finish(List<Constant> constants) {
        valueRef = (ConstantUtf8Info) constants.get(refIndex);
    }

    @Override
    public String toString() {
        return valueRef.toString();
    }
}
